home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / CodeWarrior Lite / Metrowerks C⁄C++ Lite / Headers / System Extras Headers / AOCE Headers / OCEMessaging.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-20  |  39.2 KB  |  1,479 lines  |  [TEXT/MMCC]

  1. /*
  2.     File:        OCEMessaging.h
  3.  
  4.     Copyright:    © 1984-1993 by Apple Computer, Inc., all rights reserved.
  5.  
  6.     WARNING
  7.     This file was auto generated by the interfacer tool. Modifications
  8.     must be made to the master file.
  9.  
  10. */
  11.  
  12. #ifndef __OCEMESSAGING__
  13. #define __OCEMESSAGING__
  14.  
  15. #ifndef __DIGITALSIGNATURE__
  16. #include "DigitalSignature.h"
  17. /*    #include <Files.h>                                            */
  18. /*        #include <Types.h>                                        */
  19. /*            #include <ConditionalMacros.h>                        */
  20. /*            #include <MixedMode.h>                                */
  21. /*                #include <Traps.h>                                */
  22. /*        #include <OSUtils.h>                                    */
  23. /*        #include <SegLoad.h>                                    */
  24. /*    #include <Memory.h>                                            */
  25. #endif
  26.  
  27. #ifndef __FILES__
  28. #endif
  29.  
  30. #ifndef    __OCE__
  31. #include "OCE.h"
  32. /*    #include <Aliases.h>                                        */
  33. /*        #include <AppleTalk.h>                                    */
  34. /*    #include <AppleEvents.h>                                    */
  35. /*        #include <Events.h>                                        */
  36. /*            #include <Quickdraw.h>                                */
  37. /*                #include <QuickdrawText.h>                        */
  38. /*                    #include <IntlResources.h>                    */
  39. /*        #include <EPPC.h>                                        */
  40. /*            #include <PPCToolBox.h>                                */
  41. /*            #include <Processes.h>                                */
  42. /*        #include <Notification.h>                                */
  43. /*    #include <Script.h>                                            */
  44. #endif
  45.  
  46. #ifndef __OCEAUTHDIR__
  47. #include "OCEAuthDir.h"
  48. #endif
  49.  
  50. #ifndef __TYPES__
  51. #endif
  52.  
  53. /******************************************************************************/
  54. /* Definitions common to OCEMessaging and to OCEMail. These relate to addressing,
  55. message ids and priorities, etc. */
  56.  
  57.  
  58. /* Values of IPMPriority */
  59. enum  {
  60.     kIPMAnyPriority                = 0,
  61.     kIPMNormalPriority            = 1,
  62.     kIPMLowPriority,
  63.     kIPMHighPriority
  64. };
  65.  
  66. typedef Byte IPMPriority;
  67.  
  68. /* Values of IPMAccessMode */
  69. enum  {
  70.     kIPMAtMark,
  71.     kIPMFromStart,
  72.     kIPMFromLEOM,
  73.     kIPMFromMark
  74. };
  75.  
  76. typedef unsigned short IPMAccessMode;
  77.  
  78. enum  {
  79.     kIPMUpdateMsgBit            = 4,
  80.     kIPMNewMsgBit                = 5,
  81.     kIPMDeleteMsgBit            = 6
  82. };
  83.  
  84. /* Values of IPMNotificationType */
  85. enum  {
  86.     kIPMUpdateMsgMask            = 1 << kIPMUpdateMsgBit,
  87.     kIPMNewMsgMask                = 1 << kIPMNewMsgBit,
  88.     kIPMDeleteMsgMask            = 1 << kIPMDeleteMsgBit
  89. };
  90.  
  91. typedef Byte IPMNotificationType;
  92.  
  93. /* Values of IPMSenderTag */
  94. enum  {
  95.     kIPMSenderRStringTag,
  96.     kIPMSenderRecordIDTag
  97. };
  98.  
  99. typedef unsigned short IPMSenderTag;
  100.  
  101. enum  {
  102.     kIPMFromDistListBit            = 0,
  103.     kIPMDummyRecBit                = 1,
  104.     kIPMFeedbackRecBit             = 2,    /* should be redirected to feedback queue */
  105.     kIPMReporterRecBit             = 3,    /* should be redirected to reporter original queue */
  106.     kIPMBCCRecBit                 = 4        /* this recipient is blind to all recipients of message */
  107. };
  108.  
  109. /* Values of OCERecipientOffsetFlags */
  110. enum  {
  111.     kIPMFromDistListMask        = 1 << kIPMFromDistListBit,
  112.     kIPMDummyRecMask            = 1 << kIPMDummyRecBit,
  113.     kIPMFeedbackRecMask            = 1 << kIPMFeedbackRecBit,
  114.     kIPMReporterRecMask            = 1 << kIPMReporterRecBit,
  115.     kIPMBCCRecMask                = 1 << kIPMBCCRecBit
  116. };
  117.  
  118. typedef Byte OCERecipientOffsetFlags;
  119.  
  120. #if defined(powerc) || defined (__powerc)
  121. #pragma options align=mac68k
  122. #endif
  123. struct OCECreatorType {
  124.     OSType                        msgCreator;
  125.     OSType                        msgType;
  126. };
  127. #if defined(powerc) || defined(__powerc)
  128. #pragma options align=reset
  129. #endif
  130.  
  131. typedef struct OCECreatorType OCECreatorType;
  132.  
  133. #define kIPMTypeWildCard 'ipmw'
  134.  
  135. #define kIPMFamilyUnspecified 0
  136. #define kIPMFamilyWildCard 0x3F3F3F3FL
  137.                           /* '????' */
  138.  
  139. /* well known signature */
  140. #define kIPMSignature            'ipms'    /* base type */
  141.  
  142. /* well known message types */
  143. #define kIPMReportNotify        'rptn'    /* routing feedback */
  144.  
  145. /* well known message block types */
  146. #define kIPMEnclosedMsgType        'emsg'    /* enclosed (nested) message */
  147. #define kIPMReportInfo            'rpti'    /* recipient information */
  148. #define kIPMDigitalSignature     'dsig'    /* digital signature */
  149.  
  150. /* Values of IPMMsgFormat */
  151. enum  {
  152.     kIPMOSFormatType            = 1,
  153.     kIPMStringFormatType        = 2
  154. };
  155.  
  156. typedef unsigned short IPMMsgFormat;
  157.  
  158. typedef Str32 IPMStringMsgType;
  159.  
  160. #if defined(powerc) || defined (__powerc)
  161. #pragma options align=mac68k
  162. #endif
  163. struct IPMMsgType {
  164.     IPMMsgFormat                format;
  165.     union {
  166.         OCECreatorType                msgOSType;
  167.         IPMStringMsgType            msgStrType;
  168.     }                            theType;
  169. };
  170. #if defined(powerc) || defined(__powerc)
  171. #pragma options align=reset
  172. #endif
  173.  
  174. typedef struct IPMMsgType IPMMsgType;
  175.  
  176. /*
  177. Following are the known extension values for IPM addresses handled by Apple.
  178. We define the definition of the entn extension below.
  179. */
  180.  
  181. enum  {
  182.     kOCEalanXtn                    = 'alan',
  183.     kOCEentnXtn                    = 'entn',        /* entn = entity name (aka DSSpec) */
  184.     kOCEaphnXtn                    = 'aphn'
  185. };
  186.  
  187. /*
  188. Following are the specific definitions for the extension for the standard
  189. OCEMail 'entn' addresses.  [Note, the actual extension is formatted as in
  190. IPMEntityNameExtension.]
  191. */
  192.  
  193. /* entn extension forms */
  194. enum  {
  195.     kOCEAddrXtn                    = 'addr',
  196.     kOCEQnamXtn                    = 'qnam',
  197.     kOCEAttrXtn                    = 'attr',        /* an attribute specification */
  198.     kOCESpAtXtn                    = 'spat'        /* specific attribute */
  199. };
  200.  
  201. /*
  202. Following are the specific definitions for standard
  203. OCEMail 'aphn' extension value.  
  204.  
  205. All RStrings here are packed (e.g. truncated to length) and even padded (e.g.
  206. if length odd, then a pad byte (zero) should be introduced before the next field).
  207.  
  208. The extension value is in the packed form of the following structure:
  209.     RString        phoneNumber;
  210.     RString        modemType;
  211.     Str32        queueuName;
  212.  
  213. The body of phoneNumber compound RString is in the packed form of the following structure:
  214.     short         subType;
  215.     RString     countryCode;                // used when subType == kOCEUseHandyDial
  216.     RString        areaCode;                    // used when subType == kOCEUseHandyDial
  217.     RString        phone;                        // used when subType == kOCEUseHandyDial
  218.     RString        postFix;                    // used when subType == kOCEUseHandyDial
  219.     RString        nonHandyDialString;            // used when subType == kOCEDontUseHandyDial
  220. */
  221.  
  222. /* phoneNumber sub type constants */
  223. enum  {
  224.     kOCEUseHandyDial            = 1,
  225.     kOCEDontUseHandyDial        = 2
  226. };
  227.  
  228. /* FORMAT OF A PACKED FORM RECIPIENT */
  229. #define OCEPackedRecipientHeader  \
  230.     unsigned short    dataLength;
  231.  
  232. #if defined(powerc) || defined (__powerc)
  233. #pragma options align=mac68k
  234. #endif
  235. struct ProtoOCEPackedRecipient {
  236.     unsigned short                dataLength;
  237. };
  238. #if defined(powerc) || defined(__powerc)
  239. #pragma options align=reset
  240. #endif
  241.  
  242. typedef struct ProtoOCEPackedRecipient ProtoOCEPackedRecipient;
  243.  
  244. #define kOCEPackedRecipientMaxBytes (4096 - sizeof(ProtoOCEPackedRecipient))
  245.  
  246. #if defined(powerc) || defined (__powerc)
  247. #pragma options align=mac68k
  248. #endif
  249. struct OCEPackedRecipient {
  250.     unsigned short                dataLength;
  251.     Byte                        data[(4096 - sizeof(ProtoOCEPackedRecipient))];
  252. };
  253. #if defined(powerc) || defined(__powerc)
  254. #pragma options align=reset
  255. #endif
  256.  
  257. typedef struct OCEPackedRecipient OCEPackedRecipient;
  258.  
  259. #if defined(powerc) || defined (__powerc)
  260. #pragma options align=mac68k
  261. #endif
  262. struct IPMEntnQueueExtension {
  263.     Str32                        queueName;
  264. };
  265. #if defined(powerc) || defined(__powerc)
  266. #pragma options align=reset
  267. #endif
  268.  
  269. typedef struct IPMEntnQueueExtension IPMEntnQueueExtension;
  270.  
  271. #if defined(powerc) || defined (__powerc)
  272. #pragma options align=mac68k
  273. #endif
  274. /* kOCEAttrXtn */
  275. struct IPMEntnAttributeExtension {
  276.     AttributeType                attributeName;
  277. };
  278. #if defined(powerc) || defined(__powerc)
  279. #pragma options align=reset
  280. #endif
  281.  
  282. typedef struct IPMEntnAttributeExtension IPMEntnAttributeExtension;
  283.  
  284. #if defined(powerc) || defined (__powerc)
  285. #pragma options align=mac68k
  286. #endif
  287. /* kOCESpAtXtn */
  288. struct IPMEntnSpecificAttributeExtension {
  289.     AttributeCreationID            attributeCreationID;
  290.     AttributeType                attributeName;
  291. };
  292. #if defined(powerc) || defined(__powerc)
  293. #pragma options align=reset
  294. #endif
  295.  
  296. typedef struct IPMEntnSpecificAttributeExtension IPMEntnSpecificAttributeExtension;
  297.  
  298. /* All IPM entn extensions fit within the following */
  299. #if defined(powerc) || defined (__powerc)
  300. #pragma options align=mac68k
  301. #endif
  302. struct IPMEntityNameExtension {
  303.     OSType                        subExtensionType;
  304.     union {
  305.         IPMEntnSpecificAttributeExtension specificAttribute;
  306.         IPMEntnAttributeExtension    attribute;
  307.         IPMEntnQueueExtension        queue;
  308.     }                            u;
  309. };
  310. #if defined(powerc) || defined(__powerc)
  311. #pragma options align=reset
  312. #endif
  313.  
  314. typedef struct IPMEntityNameExtension IPMEntityNameExtension;
  315.  
  316. /* addresses with kIPMNBPXtn should specify this nbp type */
  317. #define kIPMWSReceiverNBPType "\pMsgReceiver"
  318.  
  319. #if defined(powerc) || defined (__powerc)
  320. #pragma options align=mac68k
  321. #endif
  322. struct IPMMsgID {
  323.     unsigned long                id[4];
  324. };
  325. #if defined(powerc) || defined(__powerc)
  326. #pragma options align=reset
  327. #endif
  328.  
  329. typedef struct IPMMsgID IPMMsgID;
  330.  
  331. /* Values of IPMHeaderSelector */
  332. enum  {
  333.     kIPMTOC                        = 0,
  334.     kIPMSender                    = 1,
  335.     kIPMProcessHint                = 2,
  336.     kIPMMessageTitle            = 3,
  337.     kIPMMessageType                = 4,
  338.     kIPMFixedInfo                = 7
  339. };
  340.  
  341. typedef Byte IPMHeaderSelector;
  342.  
  343. #if defined(powerc) || defined (__powerc)
  344. #pragma options align=mac68k
  345. #endif
  346. struct IPMSender {
  347.     IPMSenderTag                sendTag;
  348.     union {
  349.         RString                        rString;
  350.         PackedRecordID                rid;
  351.     }                            theSender;
  352. };
  353. #if defined(powerc) || defined(__powerc)
  354. #pragma options align=reset
  355. #endif
  356.  
  357. typedef struct IPMSender IPMSender;
  358.  
  359. typedef DSSpec OCERecipient;
  360.  
  361. /******************************************************************************/
  362. /* Definitions specific to OCEMessaging */
  363.  
  364. typedef unsigned long IPMContextRef;
  365. typedef unsigned long IPMQueueRef;
  366. typedef unsigned long IPMMsgRef;
  367. typedef unsigned long IPMSeqNum;
  368. typedef Str32 IPMProcHint;
  369. typedef Str32 IPMQueueName;
  370.  
  371. typedef pascal void (*IPMNoteProcPtr)(IPMQueueRef queue, IPMSeqNum seqNum, IPMNotificationType notificationType, unsigned long userData);
  372.  
  373. enum {
  374.     uppIPMNoteProcInfo = kPascalStackBased
  375.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(IPMQueueRef)))
  376.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(IPMSeqNum)))
  377.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(IPMNotificationType)))
  378.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(unsigned long)))
  379. };
  380.  
  381. #if USESROUTINEDESCRIPTORS
  382. typedef UniversalProcPtr IPMNoteUPP;
  383.  
  384. #define CallIPMNoteProc(userRoutine, queue, seqNum, notificationType, userData)        \
  385.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppIPMNoteProcInfo, (queue), (seqNum), (notificationType), (userData))
  386. #define NewIPMNoteProc(userRoutine)        \
  387.         (IPMNoteUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppIPMNoteProcInfo, GetCurrentISA())
  388. #else
  389. typedef IPMNoteProcPtr IPMNoteUPP;
  390.  
  391. #define CallIPMNoteProc(userRoutine, queue, seqNum, notificationType, userData)        \
  392.         (*(userRoutine))((queue), (seqNum), (notificationType), (userData))
  393. #define NewIPMNoteProc(userRoutine)        \
  394.         (IPMNoteUPP)(userRoutine)
  395. #endif
  396.  
  397. #if defined(powerc) || defined (__powerc)
  398. #pragma options align=mac68k
  399. #endif
  400. struct IPMFixedHdrInfo {
  401.     unsigned short                version;
  402.     Boolean                        authenticated;
  403.     Boolean                        signatureEnclosed;        /*  digital signature enclosed */
  404.     unsigned long                msgSize;
  405.     IPMNotificationType            notification;
  406.     IPMPriority                    priority;
  407.     unsigned short                blockCount;
  408.     unsigned short                originalRcptCount;        /*        original number of recipients */
  409.     unsigned long                refCon;                    /*        Client defined data */
  410.     unsigned short                reserved;
  411.     UTCTime                        creationTime;
  412.     IPMMsgID                    msgID;
  413.     OSType                        family;                    /* family this msg belongs (e.g. mail) */
  414. };
  415. #if defined(powerc) || defined(__powerc)
  416. #pragma options align=reset
  417. #endif
  418.  
  419. typedef struct IPMFixedHdrInfo IPMFixedHdrInfo;
  420.  
  421. enum  {
  422.     kIPMDeliveryNotificationBit        = 0,
  423.     kIPMNonDeliveryNotificationBit  = 1,
  424.     kIPMEncloseOriginalBit            = 2,
  425.     kIPMSummaryReportBit            = 3,
  426.     kIPMOriginalOnlyOnErrorBit        = 4        /* modify enclose original to only on error */
  427. };
  428.  
  429. enum  {
  430.     kIPMNoNotificationMask        = 0x00,
  431.     kIPMDeliveryNotificationMask = 1 << kIPMDeliveryNotificationBit,
  432.     kIPMNonDeliveryNotificationMask = 1 << kIPMNonDeliveryNotificationBit,
  433.     kIPMDontEncloseOriginalMask    = 0x00,
  434.     kIPMEncloseOriginalMask        = 1 << kIPMEncloseOriginalBit,
  435.     kIPMImmediateReportMask        = 0x00,
  436.     kIPMSummaryReportMask        = 1 << kIPMSummaryReportBit,
  437.     kIPMOriginalOnlyOnErrorMask    = 1 << kIPMOriginalOnlyOnErrorBit,
  438.     kIPMEncloseOriginalOnErrorMask = (kIPMOriginalOnlyOnErrorMask|kIPMEncloseOriginalMask)
  439. };
  440.  
  441. /* standard Non delivery codes */
  442. enum  {
  443.     kIPMNoSuchRecipient                = 0x0001,
  444.     kIPMRecipientMalformed            = 0x0002,
  445.     kIPMRecipientAmbiguous            = 0x0003,
  446.     kIPMRecipientAccessDenied        = 0x0004,
  447.     kIPMGroupExpansionProblem        = 0x0005,
  448.     kIPMMsgUnreadable                = 0x0006,
  449.     kIPMMsgExpired                    = 0x0007,
  450.     kIPMMsgNoTranslatableContent     = 0x0008,
  451.     kIPMRecipientReqStdCont            = 0x0009,
  452.     kIPMRecipientReqSnapShot        = 0x000A,
  453.     kIPMNoTransferDiskFull            = 0x000B,
  454.     kIPMNoTransferMsgRejectedbyDest = 0x000C,
  455.     kIPMNoTransferMsgTooLarge        = 0x000D
  456. };
  457.  
  458. /*************************************************************************/
  459. /*
  460. This is the structure that will be returned by enumerate and getmsginfo
  461. This definition is just to give you a template, the position of msgType
  462. is variable since this is a packed structure.  procHint and msgType are
  463. packed and even length padded.
  464. */
  465. #if defined(powerc) || defined (__powerc)
  466. #pragma options align=mac68k
  467. #endif
  468. struct IPMMsgInfo {
  469.     IPMSeqNum                    sequenceNum;
  470.     unsigned long                userData;
  471.     unsigned short                respIndex;
  472.     Byte                        padByte;
  473.     IPMPriority                    priority;
  474.     unsigned long                msgSize;
  475.     unsigned short                originalRcptCount;
  476.     unsigned short                reserved;
  477.     UTCTime                        creationTime;
  478.     IPMMsgID                    msgID;
  479.     OSType                        family;            /* family this msg belongs (e.g. mail) */
  480.     IPMProcHint                    procHint;
  481.     IPMMsgType                    msgType;
  482. };
  483. #if defined(powerc) || defined(__powerc)
  484. #pragma options align=reset
  485. #endif
  486.  
  487. typedef struct IPMMsgInfo IPMMsgInfo;
  488.  
  489. typedef OCECreatorType IPMBlockType;
  490.  
  491. #if defined(powerc) || defined (__powerc)
  492. #pragma options align=mac68k
  493. #endif
  494. struct IPMTOC {
  495.     IPMBlockType                blockType;
  496.     long                        blockOffset;
  497.     unsigned long                blockSize;
  498.     unsigned long                blockRefCon;
  499. };
  500. #if defined(powerc) || defined(__powerc)
  501. #pragma options align=reset
  502. #endif
  503.  
  504. typedef struct IPMTOC IPMTOC;
  505.  
  506. /*
  507. The following structure is just to describe the layout of the SingleFilter.
  508. Each field should be packed and word aligned when passed to the IPM ToolBox.
  509. */
  510.  
  511. #if defined(powerc) || defined (__powerc)
  512. #pragma options align=mac68k
  513. #endif
  514. struct IPMSingleFilter {
  515.     IPMPriority                    priority;
  516.     Byte                        padByte;
  517.     OSType                        family;            /* family this msg belongs (e.g. mail), '????' for all */
  518.     ScriptCode                    script;            /* Language Identifier */
  519.     IPMProcHint                    hint;
  520.     IPMMsgType                    msgType;
  521. };
  522. #if defined(powerc) || defined(__powerc)
  523. #pragma options align=reset
  524. #endif
  525.  
  526. typedef struct IPMSingleFilter IPMSingleFilter;
  527.  
  528. #if defined(powerc) || defined (__powerc)
  529. #pragma options align=mac68k
  530. #endif
  531. struct IPMFilter {
  532.     unsigned short                count;
  533.     IPMSingleFilter                sFilters[1];
  534. };
  535. #if defined(powerc) || defined(__powerc)
  536. #pragma options align=reset
  537. #endif
  538.  
  539. typedef struct IPMFilter IPMFilter;
  540.  
  541. /*************************************************************************/
  542. /*
  543. Following structures define the “start” of a recipient report block and the
  544. elements of the array respectively.
  545. */
  546.  
  547. #if defined(powerc) || defined (__powerc)
  548. #pragma options align=mac68k
  549. #endif
  550. struct IPMReportBlockHeader {
  551.     IPMMsgID                    msgID;
  552.     UTCTime                        creationTime;
  553. };
  554. #if defined(powerc) || defined(__powerc)
  555. #pragma options align=reset
  556. #endif
  557.  
  558. typedef struct IPMReportBlockHeader IPMReportBlockHeader;
  559.  
  560. #if defined(powerc) || defined (__powerc)
  561. #pragma options align=mac68k
  562. #endif
  563. struct OCERecipientReport {
  564.     unsigned short                rcptIndex;
  565.     OSErr                        result;
  566. };
  567. #if defined(powerc) || defined(__powerc)
  568. #pragma options align=reset
  569. #endif
  570.  
  571. typedef struct OCERecipientReport OCERecipientReport;
  572.  
  573. typedef union IPMParamBlock IPMParamBlock;
  574. typedef IPMParamBlock *IPMParamBlockPtr;
  575.  
  576.  
  577. /*
  578.     IPMIOCompletionProcs cannot be written in or called from a high-level 
  579.     language without the help of mixed mode or assembly glue because they 
  580.     use the following parameter-passing convention:
  581.  
  582.     typedef pascal void (*IPMIOCompletionProcPtr)(IPMParamBlockPtr paramBlock);
  583.  
  584.         In:
  585.             =>     paramBlock                A0.L
  586.         Out:
  587.             none
  588. */
  589.  
  590. enum  {
  591.     uppIPMIOCompletionProcInfo        = kRegisterBased|REGISTER_ROUTINE_PARAMETER(1,kRegisterA0,kFourByteCode)
  592. };
  593.  
  594. #if USESROUTINEDESCRIPTORS
  595. typedef pascal void (*IPMIOCompletionProcPtr)(IPMParamBlockPtr paramBlock);
  596.  
  597. typedef UniversalProcPtr IPMIOCompletionUPP;
  598.  
  599. #define CallIPMIOCompletionProc(userRoutine, paramBlock)  \
  600.     CallUniversalProc((UniversalProcPtr)(userRoutine), uppIPMIOCompletionProcInfo, (paramBlock))
  601.  
  602. #define NewIPMIOCompletionProc(userRoutine)  \
  603.     (IPMIOCompletionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine),  \
  604.     uppIPMIOCompletionProcInfo, GetCurrentISA())
  605.  
  606. #else
  607. typedef ProcPtr IPMIOCompletionUPP;
  608.  
  609. #define NewIPMIOCompletionProc(userRoutine)  \
  610.     (IPMIOCompletionUPP)((userRoutine))
  611.  
  612. #endif
  613.  
  614. #define IPMParamHeader                             \
  615.     Ptr                    qLink;                    \
  616.     long                reservedH1;                \
  617.     long                reservedH2;                \
  618.     IPMIOCompletionUPP    ioCompletion;            \
  619.     OSErr                ioResult;                \
  620.     long                saveA5;                    \
  621.     short                reqCode;
  622.  
  623. #if defined(powerc) || defined (__powerc)
  624. #pragma options align=mac68k
  625. #endif
  626. struct IPMOpenContextPB {
  627.     Ptr                            qLink;
  628.     long                        reservedH1;
  629.     long                        reservedH2;
  630.     IPMIOCompletionUPP            ioCompletion;
  631.     OSErr                        ioResult;
  632.     long                        saveA5;
  633.     short                        reqCode;
  634.     IPMContextRef                contextRef;        /* <--  Context reference to be used in further calls*/
  635. };
  636. #if defined(powerc) || defined(__powerc)
  637. #pragma options align=reset
  638. #endif
  639.  
  640. typedef struct IPMOpenContextPB IPMOpenContextPB;
  641.  
  642. typedef IPMOpenContextPB IPMCloseContextPB;
  643.  
  644. #if defined(powerc) || defined (__powerc)
  645. #pragma options align=mac68k
  646. #endif
  647. struct IPMCreateQueuePB {
  648.     Ptr                            qLink;
  649.     long                        reservedH1;
  650.     long                        reservedH2;
  651.     IPMIOCompletionUPP            ioCompletion;
  652.     OSErr                        ioResult;
  653.     long                        saveA5;
  654.     short                        reqCode;
  655.     long                        filler1;
  656.     OCERecipient                *queue;
  657.     AuthIdentity                identity;        /* used only if queue is remote */
  658.     PackedRecordID                *owner;            /* used only if queue is remote */
  659. };
  660. #if defined(powerc) || defined(__powerc)
  661. #pragma options align=reset
  662. #endif
  663.  
  664. typedef struct IPMCreateQueuePB IPMCreateQueuePB;
  665.  
  666. /* For createqueue and deletequeue only queue and identity are used */
  667. typedef IPMCreateQueuePB IPMDeleteQueuePB;
  668.  
  669. #if defined(powerc) || defined (__powerc)
  670. #pragma options align=mac68k
  671. #endif
  672. struct IPMOpenQueuePB {
  673.     Ptr                            qLink;
  674.     long                        reservedH1;
  675.     long                        reservedH2;
  676.     IPMIOCompletionUPP            ioCompletion;
  677.     OSErr                        ioResult;
  678.     long                        saveA5;
  679.     short                        reqCode;
  680.     IPMContextRef                contextRef;
  681.     OCERecipient                *queue;
  682.     AuthIdentity                identity;
  683.     IPMFilter                    *filter;
  684.     IPMQueueRef                    newQueueRef;
  685.     IPMNoteUPP                    notificationProc;
  686.     unsigned long                userData;
  687.     IPMNotificationType            noteType;
  688.     Byte                        padByte;
  689.     long                        reserved;
  690.     long                        reserved2;
  691. };
  692. #if defined(powerc) || defined(__powerc)
  693. #pragma options align=reset
  694. #endif
  695.  
  696. typedef struct IPMOpenQueuePB IPMOpenQueuePB;
  697.  
  698. #if defined(powerc) || defined (__powerc)
  699. #pragma options align=mac68k
  700. #endif
  701. struct IPMCloseQueuePB {
  702.     Ptr                            qLink;
  703.     long                        reservedH1;
  704.     long                        reservedH2;
  705.     IPMIOCompletionUPP            ioCompletion;
  706.     OSErr                        ioResult;
  707.     long                        saveA5;
  708.     short                        reqCode;
  709.     IPMQueueRef                    queueRef;
  710. };
  711. #if defined(powerc) || defined(__powerc)
  712. #pragma options align=reset
  713. #endif
  714.  
  715. typedef struct IPMCloseQueuePB IPMCloseQueuePB;
  716.  
  717. #if defined(powerc) || defined (__powerc)
  718. #pragma options align=mac68k
  719. #endif
  720. struct IPMEnumerateQueuePB {
  721.     Ptr                            qLink;
  722.     long                        reservedH1;
  723.     long                        reservedH2;
  724.     IPMIOCompletionUPP            ioCompletion;
  725.     OSErr                        ioResult;
  726.     long                        saveA5;
  727.     short                        reqCode;
  728.     IPMQueueRef                    queueRef;
  729.     IPMSeqNum                    startSeqNum;
  730.     Boolean                        getProcHint;
  731.     Boolean                        getMsgType;
  732.     short                        filler;
  733.     IPMFilter                    *filter;
  734.     unsigned short                numToGet;
  735.     unsigned short                numGotten;
  736.     unsigned long                enumCount;
  737.     Ptr                            enumBuffer;        /* will be packed array of IPMMsgInfo */
  738.     unsigned long                actEnumCount;
  739. };
  740. #if defined(powerc) || defined(__powerc)
  741. #pragma options align=reset
  742. #endif
  743.  
  744. typedef struct IPMEnumerateQueuePB IPMEnumerateQueuePB;
  745.  
  746. typedef IPMEnumerateQueuePB IPMChangeQueueFilterPB;
  747.  
  748. #if defined(powerc) || defined (__powerc)
  749. #pragma options align=mac68k
  750. #endif
  751. struct IPMDeleteMsgRangePB {
  752.     Ptr                            qLink;
  753.     long                        reservedH1;
  754.     long                        reservedH2;
  755.     IPMIOCompletionUPP            ioCompletion;
  756.     OSErr                        ioResult;
  757.     long                        saveA5;
  758.     short                        reqCode;
  759.     IPMQueueRef                    queueRef;
  760.     IPMSeqNum                    startSeqNum;
  761.     IPMSeqNum                    endSeqNum;
  762.     IPMSeqNum                    lastSeqNum;
  763. };
  764. #if defined(powerc) || defined(__powerc)
  765. #pragma options align=reset
  766. #endif
  767.  
  768. typedef struct IPMDeleteMsgRangePB IPMDeleteMsgRangePB;
  769.  
  770. #if defined(powerc) || defined (__powerc)
  771. #pragma options align=mac68k
  772. #endif
  773. struct IPMOpenMsgPB {
  774.     Ptr                            qLink;
  775.     long                        reservedH1;
  776.     long                        reservedH2;
  777.     IPMIOCompletionUPP            ioCompletion;
  778.     OSErr                        ioResult;
  779.     long                        saveA5;
  780.     short                        reqCode;
  781.     IPMQueueRef                    queueRef;
  782.     IPMSeqNum                    sequenceNum;
  783.     IPMMsgRef                    newMsgRef;
  784.     IPMSeqNum                    actualSeqNum;
  785.     Boolean                        exactMatch;
  786.     Byte                        padByte;
  787.     long                        reserved;
  788. };
  789. #if defined(powerc) || defined(__powerc)
  790. #pragma options align=reset
  791. #endif
  792.  
  793. typedef struct IPMOpenMsgPB IPMOpenMsgPB;
  794.  
  795. #if defined(powerc) || defined (__powerc)
  796. #pragma options align=mac68k
  797. #endif
  798. struct IPMOpenHFSMsgPB {
  799.     Ptr                            qLink;
  800.     long                        reservedH1;
  801.     long                        reservedH2;
  802.     IPMIOCompletionUPP            ioCompletion;
  803.     OSErr                        ioResult;
  804.     long                        saveA5;
  805.     short                        reqCode;
  806.     FSSpec                        *hfsPath;
  807.     long                        filler;
  808.     IPMMsgRef                    newMsgRef;
  809.     long                        filler2;
  810.     Byte                        filler3;
  811.     long                        reserved;
  812. };
  813. #if defined(powerc) || defined(__powerc)
  814. #pragma options align=reset
  815. #endif
  816.  
  817. typedef struct IPMOpenHFSMsgPB IPMOpenHFSMsgPB;
  818.  
  819. #if defined(powerc) || defined (__powerc)
  820. #pragma options align=mac68k
  821. #endif
  822. struct IPMOpenBlockAsMsgPB {
  823.     Ptr                            qLink;
  824.     long                        reservedH1;
  825.     long                        reservedH2;
  826.     IPMIOCompletionUPP            ioCompletion;
  827.     OSErr                        ioResult;
  828.     long                        saveA5;
  829.     short                        reqCode;
  830.     IPMMsgRef                    msgRef;
  831.     unsigned long                filler;
  832.     IPMMsgRef                    newMsgRef;
  833.     unsigned short                filler2[7];
  834.     unsigned short                blockIndex;
  835. };
  836. #if defined(powerc) || defined(__powerc)
  837. #pragma options align=reset
  838. #endif
  839.  
  840. typedef struct IPMOpenBlockAsMsgPB IPMOpenBlockAsMsgPB;
  841.  
  842. #if defined(powerc) || defined (__powerc)
  843. #pragma options align=mac68k
  844. #endif
  845. struct IPMCloseMsgPB {
  846.     Ptr                            qLink;
  847.     long                        reservedH1;
  848.     long                        reservedH2;
  849.     IPMIOCompletionUPP            ioCompletion;
  850.     OSErr                        ioResult;
  851.     long                        saveA5;
  852.     short                        reqCode;
  853.     IPMMsgRef                    msgRef;
  854.     Boolean                        deleteMsg;
  855. };
  856. #if defined(powerc) || defined(__powerc)
  857. #pragma options align=reset
  858. #endif
  859.  
  860. typedef struct IPMCloseMsgPB IPMCloseMsgPB;
  861.  
  862. #if defined(powerc) || defined (__powerc)
  863. #pragma options align=mac68k
  864. #endif
  865. struct IPMGetMsgInfoPB {
  866.     Ptr                            qLink;
  867.     long                        reservedH1;
  868.     long                        reservedH2;
  869.     IPMIOCompletionUPP            ioCompletion;
  870.     OSErr                        ioResult;
  871.     long                        saveA5;
  872.     short                        reqCode;
  873.     IPMMsgRef                    msgRef;
  874.     IPMMsgInfo                    *info;
  875. };
  876. #if defined(powerc) || defined(__powerc)
  877. #pragma options align=reset
  878. #endif
  879.  
  880. typedef struct IPMGetMsgInfoPB IPMGetMsgInfoPB;
  881.  
  882. #if defined(powerc) || defined (__powerc)
  883. #pragma options align=mac68k
  884. #endif
  885. struct IPMReadHeaderPB {
  886.     Ptr                            qLink;
  887.     long                        reservedH1;
  888.     long                        reservedH2;
  889.     IPMIOCompletionUPP            ioCompletion;
  890.     OSErr                        ioResult;
  891.     long                        saveA5;
  892.     short                        reqCode;
  893.     IPMMsgRef                    msgRef;
  894.     unsigned short                fieldSelector;
  895.     long                        offset;
  896.     unsigned long                count;
  897.     Ptr                            buffer;
  898.     unsigned long                actualCount;
  899.     unsigned short                filler;
  900.     unsigned long                remaining;
  901. };
  902. #if defined(powerc) || defined(__powerc)
  903. #pragma options align=reset
  904. #endif
  905.  
  906. typedef struct IPMReadHeaderPB IPMReadHeaderPB;
  907.  
  908. /*
  909. replyQueue works like recipient. [can no longer read it via ReadHeader]
  910. OriginalIndex is meaningless, rcptFlags are used seperately and there are
  911. currently none defined.
  912. */
  913. #if defined(powerc) || defined (__powerc)
  914. #pragma options align=mac68k
  915. #endif
  916. struct IPMReadRecipientPB {
  917.     Ptr                            qLink;
  918.     long                        reservedH1;
  919.     long                        reservedH2;
  920.     IPMIOCompletionUPP            ioCompletion;
  921.     OSErr                        ioResult;
  922.     long                        saveA5;
  923.     short                        reqCode;
  924.     IPMMsgRef                    msgRef;
  925.     unsigned short                rcptIndex;
  926.     long                        offset;
  927.     unsigned long                count;
  928.     Ptr                            buffer;
  929.     unsigned long                actualCount;
  930.     short                        reserved;            /* must be zero */
  931.     unsigned long                remaining;
  932.     unsigned short                originalIndex;
  933.     OCERecipientOffsetFlags        recipientOffsetFlags;
  934. };
  935. #if defined(powerc) || defined(__powerc)
  936. #pragma options align=reset
  937. #endif
  938.  
  939. typedef struct IPMReadRecipientPB IPMReadRecipientPB;
  940.  
  941. typedef IPMReadRecipientPB IPMReadReplyQueuePB;
  942.  
  943. #if defined(powerc) || defined (__powerc)
  944. #pragma options align=mac68k
  945. #endif
  946. struct IPMGetBlkIndexPB {
  947.     Ptr                            qLink;
  948.     long                        reservedH1;
  949.     long                        reservedH2;
  950.     IPMIOCompletionUPP            ioCompletion;
  951.     OSErr                        ioResult;
  952.     long                        saveA5;
  953.     short                        reqCode;
  954.     IPMMsgRef                    msgRef;
  955.     IPMBlockType                blockType;
  956.     unsigned short                index;
  957.     unsigned short                startingFrom;
  958.     IPMBlockType                actualBlockType;
  959.     unsigned short                actualBlockIndex;
  960. };
  961. #if defined(powerc) || defined(__powerc)
  962. #pragma options align=reset
  963. #endif
  964.  
  965. typedef struct IPMGetBlkIndexPB IPMGetBlkIndexPB;
  966.  
  967. #if defined(powerc) || defined (__powerc)
  968. #pragma options align=mac68k
  969. #endif
  970. struct IPMReadMsgPB {
  971.     Ptr                            qLink;
  972.     long                        reservedH1;
  973.     long                        reservedH2;
  974.     IPMIOCompletionUPP            ioCompletion;
  975.     OSErr                        ioResult;
  976.     long                        saveA5;
  977.     short                        reqCode;
  978.     IPMMsgRef                    msgRef;
  979.     IPMAccessMode                mode;
  980.     long                        offset;
  981.     unsigned long                count;
  982.     Ptr                            buffer;
  983.     unsigned long                actualCount;
  984.     unsigned short                blockIndex;
  985.     unsigned long                remaining;
  986. };
  987. #if defined(powerc) || defined(__powerc)
  988. #pragma options align=reset
  989. #endif
  990.  
  991. typedef struct IPMReadMsgPB IPMReadMsgPB;
  992.  
  993. #if defined(powerc) || defined (__powerc)
  994. #pragma options align=mac68k
  995. #endif
  996. struct IPMVerifySignaturePB {
  997.     Ptr                            qLink;
  998.     long                        reservedH1;
  999.     long                        reservedH2;
  1000.     IPMIOCompletionUPP            ioCompletion;
  1001.     OSErr                        ioResult;
  1002.     long                        saveA5;
  1003.     short                        reqCode;
  1004.     IPMMsgRef                    msgRef;
  1005.     SIGContextPtr                signatureContext;
  1006. };
  1007. #if defined(powerc) || defined(__powerc)
  1008. #pragma options align=reset
  1009. #endif
  1010.  
  1011. typedef struct IPMVerifySignaturePB IPMVerifySignaturePB;
  1012.  
  1013. #if defined(powerc) || defined (__powerc)
  1014. #pragma options align=mac68k
  1015. #endif
  1016. struct IPMNewMsgPB {
  1017.     Ptr                            qLink;
  1018.     long                        reservedH1;
  1019.     long                        reservedH2;
  1020.     IPMIOCompletionUPP            ioCompletion;
  1021.     OSErr                        ioResult;
  1022.     long                        saveA5;
  1023.     short                        reqCode;
  1024.     unsigned long                filler;
  1025.     OCERecipient                *recipient;
  1026.     OCERecipient                *replyQueue;
  1027.     StringPtr                    procHint;
  1028.     unsigned short                filler2;
  1029.     IPMMsgType                    *msgType;
  1030.     unsigned long                refCon;
  1031.     IPMMsgRef                    newMsgRef;
  1032.     unsigned short                filler3;
  1033.     long                        filler4;
  1034.     AuthIdentity                identity;
  1035.     IPMSender                    *sender;
  1036.     unsigned long                internalUse;
  1037.     unsigned long                internalUse2;
  1038. };
  1039. #if defined(powerc) || defined(__powerc)
  1040. #pragma options align=reset
  1041. #endif
  1042.  
  1043. typedef struct IPMNewMsgPB IPMNewMsgPB;
  1044.  
  1045. #if defined(powerc) || defined (__powerc)
  1046. #pragma options align=mac68k
  1047. #endif
  1048. struct IPMNewHFSMsgPB {
  1049.     Ptr                            qLink;
  1050.     long                        reservedH1;
  1051.     long                        reservedH2;
  1052.     IPMIOCompletionUPP            ioCompletion;
  1053.     OSErr                        ioResult;
  1054.     long                        saveA5;
  1055.     short                        reqCode;
  1056.     FSSpec                        *hfsPath;
  1057.     OCERecipient                *recipient;
  1058.     OCERecipient                *replyQueue;
  1059.     StringPtr                    procHint;
  1060.     unsigned short                filler2;
  1061.     IPMMsgType                    *msgType;
  1062.     unsigned long                refCon;
  1063.     IPMMsgRef                    newMsgRef;
  1064.     unsigned short                filler3;
  1065.     long                        filler4;
  1066.     AuthIdentity                identity;
  1067.     IPMSender                    *sender;
  1068.     unsigned long                internalUse;
  1069.     unsigned long                internalUse2;
  1070. };
  1071. #if defined(powerc) || defined(__powerc)
  1072. #pragma options align=reset
  1073. #endif
  1074.  
  1075. typedef struct IPMNewHFSMsgPB IPMNewHFSMsgPB;
  1076.  
  1077. #if defined(powerc) || defined (__powerc)
  1078. #pragma options align=mac68k
  1079. #endif
  1080. struct IPMNestMsgPB {
  1081.     Ptr                            qLink;
  1082.     long                        reservedH1;
  1083.     long                        reservedH2;
  1084.     IPMIOCompletionUPP            ioCompletion;
  1085.     OSErr                        ioResult;
  1086.     long                        saveA5;
  1087.     short                        reqCode;
  1088.     IPMMsgRef                    msgRef;
  1089.     unsigned short                filler[9];
  1090.     unsigned long                refCon;
  1091.     IPMMsgRef                    msgToNest;
  1092.     unsigned short                filler2;
  1093.     long                        startingOffset;
  1094. };
  1095. #if defined(powerc) || defined(__powerc)
  1096. #pragma options align=reset
  1097. #endif
  1098.  
  1099. typedef struct IPMNestMsgPB IPMNestMsgPB;
  1100.  
  1101. #if defined(powerc) || defined (__powerc)
  1102. #pragma options align=mac68k
  1103. #endif
  1104. struct IPMNewNestedMsgBlockPB {
  1105.     Ptr                            qLink;
  1106.     long                        reservedH1;
  1107.     long                        reservedH2;
  1108.     IPMIOCompletionUPP            ioCompletion;
  1109.     OSErr                        ioResult;
  1110.     long                        saveA5;
  1111.     short                        reqCode;
  1112.     IPMMsgRef                    msgRef;
  1113.     OCERecipient                *recipient;
  1114.     OCERecipient                *replyQueue;
  1115.     StringPtr                    procHint;
  1116.     unsigned short                filler1;
  1117.     IPMMsgType                    *msgType;
  1118.     unsigned long                refCon;
  1119.     IPMMsgRef                    newMsgRef;
  1120.     unsigned short                filler2;
  1121.     long                        startingOffset;
  1122.     AuthIdentity                identity;
  1123.     IPMSender                    *sender;
  1124.     unsigned long                internalUse;
  1125.     unsigned long                internalUse2;
  1126. };
  1127. #if defined(powerc) || defined(__powerc)
  1128. #pragma options align=reset
  1129. #endif
  1130.  
  1131. typedef struct IPMNewNestedMsgBlockPB IPMNewNestedMsgBlockPB;
  1132.  
  1133. #if defined(powerc) || defined (__powerc)
  1134. #pragma options align=mac68k
  1135. #endif
  1136. struct IPMEndMsgPB {
  1137.     Ptr                            qLink;
  1138.     long                        reservedH1;
  1139.     long                        reservedH2;
  1140.     IPMIOCompletionUPP            ioCompletion;
  1141.     OSErr                        ioResult;
  1142.     long                        saveA5;
  1143.     short                        reqCode;
  1144.     IPMMsgRef                    msgRef;
  1145.     IPMMsgID                    msgID;
  1146.     RString                        *msgTitle;
  1147.     IPMNotificationType            deliveryNotification;
  1148.     IPMPriority                    priority;
  1149.     Boolean                        cancel;
  1150.     Byte                        padByte;
  1151.     long                        reserved;
  1152.     SIGSignaturePtr                signature;
  1153.     Size                        signatureSize;
  1154.     SIGContextPtr                signatureContext;
  1155.     OSType                        family;            /* family this msg belongs (e.g. mail) */
  1156.                                                 /* use kIPMFamilyUnspecified by default */
  1157. };
  1158. #if defined(powerc) || defined(__powerc)
  1159. #pragma options align=reset
  1160. #endif
  1161.  
  1162. typedef struct IPMEndMsgPB IPMEndMsgPB;
  1163.  
  1164. #if defined(powerc) || defined (__powerc)
  1165. #pragma options align=mac68k
  1166. #endif
  1167. struct IPMAddRecipientPB {
  1168.     Ptr                            qLink;
  1169.     long                        reservedH1;
  1170.     long                        reservedH2;
  1171.     IPMIOCompletionUPP            ioCompletion;
  1172.     OSErr                        ioResult;
  1173.     long                        saveA5;
  1174.     short                        reqCode;
  1175.     IPMMsgRef                    msgRef;
  1176.     OCERecipient                *recipient;
  1177.     long                        reserved;
  1178. };
  1179. #if defined(powerc) || defined(__powerc)
  1180. #pragma options align=reset
  1181. #endif
  1182.  
  1183. typedef struct IPMAddRecipientPB IPMAddRecipientPB;
  1184.  
  1185. #if defined(powerc) || defined (__powerc)
  1186. #pragma options align=mac68k
  1187. #endif
  1188. struct IPMAddReplyQueuePB {
  1189.     Ptr                            qLink;
  1190.     long                        reservedH1;
  1191.     long                        reservedH2;
  1192.     IPMIOCompletionUPP            ioCompletion;
  1193.     OSErr                        ioResult;
  1194.     long                        saveA5;
  1195.     short                        reqCode;
  1196.     IPMMsgRef                    msgRef;
  1197.     long                        filler;
  1198.     OCERecipient                *replyQueue;
  1199. };
  1200. #if defined(powerc) || defined(__powerc)
  1201. #pragma options align=reset
  1202. #endif
  1203.  
  1204. typedef struct IPMAddReplyQueuePB IPMAddReplyQueuePB;
  1205.  
  1206. #if defined(powerc) || defined (__powerc)
  1207. #pragma options align=mac68k
  1208. #endif
  1209. struct IPMNewBlockPB {
  1210.     Ptr                            qLink;
  1211.     long                        reservedH1;
  1212.     long                        reservedH2;
  1213.     IPMIOCompletionUPP            ioCompletion;
  1214.     OSErr                        ioResult;
  1215.     long                        saveA5;
  1216.     short                        reqCode;
  1217.     IPMMsgRef                    msgRef;
  1218.     IPMBlockType                blockType;
  1219.     unsigned short                filler[5];
  1220.     unsigned long                refCon;
  1221.     unsigned short                filler2[3];
  1222.     long                        startingOffset;
  1223. };
  1224. #if defined(powerc) || defined(__powerc)
  1225. #pragma options align=reset
  1226. #endif
  1227.  
  1228. typedef struct IPMNewBlockPB IPMNewBlockPB;
  1229.  
  1230. #if defined(powerc) || defined (__powerc)
  1231. #pragma options align=mac68k
  1232. #endif
  1233. struct IPMWriteMsgPB {
  1234.     Ptr                            qLink;
  1235.     long                        reservedH1;
  1236.     long                        reservedH2;
  1237.     IPMIOCompletionUPP            ioCompletion;
  1238.     OSErr                        ioResult;
  1239.     long                        saveA5;
  1240.     short                        reqCode;
  1241.     IPMMsgRef                    msgRef;
  1242.     IPMAccessMode                mode;
  1243.     long                        offset;
  1244.     unsigned long                count;
  1245.     Ptr                            buffer;
  1246.     unsigned long                actualCount;
  1247.     Boolean                        currentBlock;
  1248. };
  1249. #if defined(powerc) || defined(__powerc)
  1250. #pragma options align=reset
  1251. #endif
  1252.  
  1253. typedef struct IPMWriteMsgPB IPMWriteMsgPB;
  1254.  
  1255. #if defined(powerc) || defined (__powerc)
  1256. #pragma options align=mac68k
  1257. #endif
  1258. union IPMParamBlock {
  1259.     struct {
  1260.         Ptr                            qLink;
  1261.         long                        reservedH1;
  1262.         long                        reservedH2;
  1263.         IPMIOCompletionUPP            ioCompletion;
  1264.         OSErr                        ioResult;
  1265.         long                        saveA5;
  1266.         short                        reqCode;
  1267.     }                            header;
  1268.     IPMOpenContextPB            openContextPB;
  1269.     IPMCloseContextPB            closeContextPB;
  1270.     IPMCreateQueuePB            createQueuePB;
  1271.     IPMDeleteQueuePB            deleteQueuePB;
  1272.     IPMOpenQueuePB                openQueuePB;
  1273.     IPMCloseQueuePB                closeQueuePB;
  1274.     IPMEnumerateQueuePB            enumerateQueuePB;
  1275.     IPMChangeQueueFilterPB        changeQueueFilterPB;
  1276.     IPMDeleteMsgRangePB            deleteMsgRangePB;
  1277.     IPMOpenMsgPB                openMsgPB;
  1278.     IPMOpenHFSMsgPB                openHFSMsgPB;
  1279.     IPMOpenBlockAsMsgPB            openBlockAsMsgPB;
  1280.     IPMCloseMsgPB                closeMsgPB;
  1281.     IPMGetMsgInfoPB                getMsgInfoPB;
  1282.     IPMReadHeaderPB                readHeaderPB;
  1283.     IPMReadRecipientPB            readRecipientPB;
  1284.     IPMReadReplyQueuePB            readReplyQueuePB;
  1285.     IPMGetBlkIndexPB            getBlkIndexPB;
  1286.     IPMReadMsgPB                readMsgPB;
  1287.     IPMVerifySignaturePB        verifySignaturePB;
  1288.     IPMNewMsgPB                    newMsgPB;
  1289.     IPMNewHFSMsgPB                newHFSMsgPB;
  1290.     IPMNestMsgPB                nestMsgPB;
  1291.     IPMNewNestedMsgBlockPB        newNestedMsgBlockPB;
  1292.     IPMEndMsgPB                    endMsgPB;
  1293.     IPMAddRecipientPB            addRecipientPB;
  1294.     IPMAddReplyQueuePB            addReplyQueuePB;
  1295.     IPMNewBlockPB                newBlockPB;
  1296.     IPMWriteMsgPB                writeMsgPB;
  1297. };
  1298. #if defined(powerc) || defined(__powerc)
  1299. #pragma options align=reset
  1300. #endif
  1301.  
  1302.  
  1303. /*    Request codes */
  1304. #define kIPMOpenContext 0x400
  1305. #define kIPMCloseContext 0x401
  1306. #define kIPMNewMsg 0x402
  1307. #define kIPMAddRecipient 0x403
  1308. #define kIPMNewBlock 0x404
  1309. #define kIPMNewNestedMsgBlock 0x405
  1310. #define kIPMNestMsg 0x406
  1311. #define kIPMWriteMsg 0x407
  1312. #define kIPMEndMsg 0x408
  1313. #define kIPMOpenQueue 0x409
  1314. #define kIPMCloseQueue 0x40A
  1315. #define kIPMOpenMsg 0x40B
  1316. #define kIPMCloseMsg 0x40C
  1317. #define kIPMReadMsg 0x40D
  1318. #define kIPMReadHeader 0x40E
  1319. #define kIPMOpenBlockAsMsg 0x40F
  1320. #define kIPMReadRecipient 0x410
  1321. #define kIPMCreateQueue 0x411
  1322. #define kIPMDeleteQueue 0x412
  1323. #define kIPMEnumerateQueue 0x413
  1324. #define kIPMChangeQueueFilter 0x414
  1325. #define kIPMDeleteMsgRange 0x415
  1326. #define kIPMOpenHFSMsg 0x417
  1327. #define kIPMGetBlkIndex 0x418
  1328. #define kIPMGetMsgInfo 0x419
  1329.  
  1330. #define kIPMAddReplyQueue 0x41D
  1331. #define kIPMNewHFSMsg 0x41E
  1332.  
  1333. #define kIPMReadReplyQueue 0x421
  1334. #define kIPMVerifySignature 0x422
  1335.  
  1336. #ifdef __cplusplus
  1337. extern "C" {
  1338. #endif
  1339.  
  1340. extern pascal OSErr IPMOpenContext(IPMParamBlockPtr paramBlock, Boolean async)
  1341.  THREEWORDINLINE(0x3F3C, 0x400, 0xAA5E);
  1342. extern pascal OSErr IPMCloseContext(IPMParamBlockPtr paramBlock, Boolean async)
  1343.  THREEWORDINLINE(0x3F3C, 0x401, 0xAA5E);
  1344. extern pascal OSErr IPMNewMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1345.  THREEWORDINLINE(0x3F3C, 0x402, 0xAA5E);
  1346. extern pascal OSErr IPMNewBlock(IPMParamBlockPtr paramBlock, Boolean async)
  1347.  THREEWORDINLINE(0x3F3C, 0x404, 0xAA5E);
  1348. extern pascal OSErr IPMNewNestedMsgBlock(IPMParamBlockPtr paramBlock, Boolean async)
  1349.  THREEWORDINLINE(0x3F3C, 0x405, 0xAA5E);
  1350. extern pascal OSErr IPMNestMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1351.  THREEWORDINLINE(0x3F3C, 0x406, 0xAA5E);
  1352. extern pascal OSErr IPMWriteMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1353.  THREEWORDINLINE(0x3F3C, 0x407, 0xAA5E);
  1354. extern pascal OSErr IPMEndMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1355.  THREEWORDINLINE(0x3F3C, 0x408, 0xAA5E);
  1356. extern pascal OSErr IPMOpenQueue(IPMParamBlockPtr paramBlock, Boolean async)
  1357.  THREEWORDINLINE(0x3F3C, 0x409, 0xAA5E);
  1358. extern pascal OSErr IPMCloseQueue(IPMParamBlockPtr paramBlock, Boolean async)
  1359.  THREEWORDINLINE(0x3F3C, 0x40A, 0xAA5E);
  1360.  
  1361. /* Always synchronous */
  1362. extern pascal OSErr IPMVerifySignature(IPMParamBlockPtr paramBlock)
  1363.  FIVEWORDINLINE(0x7000, 0x1f00, 0x3F3C, 0x422, 0xAA5E);
  1364.  
  1365. extern pascal OSErr IPMOpenMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1366.  THREEWORDINLINE(0x3F3C, 0x40B, 0xAA5E);
  1367. extern pascal OSErr IPMCloseMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1368.  THREEWORDINLINE(0x3F3C, 0x40C, 0xAA5E);
  1369. extern pascal OSErr IPMReadMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1370.  THREEWORDINLINE(0x3F3C, 0x40D, 0xAA5E);
  1371. extern pascal OSErr IPMReadHeader(IPMParamBlockPtr paramBlock, Boolean async)
  1372.  THREEWORDINLINE(0x3F3C, 0x40E, 0xAA5E);
  1373. extern pascal OSErr IPMOpenBlockAsMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1374.  THREEWORDINLINE(0x3F3C, 0x40F, 0xAA5E);
  1375. extern pascal OSErr IPMNewHFSMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1376.  THREEWORDINLINE(0x3F3C, 0x41E, 0xAA5E);
  1377. extern pascal OSErr IPMReadRecipient(IPMParamBlockPtr paramBlock, Boolean async)
  1378.  THREEWORDINLINE(0x3F3C, 0x410, 0xAA5E);
  1379. extern pascal OSErr IPMReadReplyQueue(IPMParamBlockPtr paramBlock, Boolean async)
  1380.  THREEWORDINLINE(0x3F3C, 0x421, 0xAA5E);
  1381. extern pascal OSErr IPMCreateQueue(IPMParamBlockPtr paramBlock, Boolean async)
  1382.  THREEWORDINLINE(0x3F3C, 0x411, 0xAA5E);
  1383. extern pascal OSErr IPMDeleteQueue(IPMParamBlockPtr paramBlock, Boolean async)
  1384.  THREEWORDINLINE(0x3F3C, 0x412, 0xAA5E);
  1385. extern pascal OSErr IPMEnumerateQueue(IPMParamBlockPtr paramBlock, Boolean async)
  1386.  THREEWORDINLINE(0x3F3C, 0x413, 0xAA5E);
  1387. extern pascal OSErr IPMChangeQueueFilter(IPMParamBlockPtr paramBlock, Boolean async)
  1388.  THREEWORDINLINE(0x3F3C, 0x414, 0xAA5E);
  1389. extern pascal OSErr IPMDeleteMsgRange(IPMParamBlockPtr paramBlock, Boolean async)
  1390.  THREEWORDINLINE(0x3F3C, 0x415, 0xAA5E);
  1391. extern pascal OSErr IPMAddRecipient(IPMParamBlockPtr paramBlock, Boolean async)
  1392.  THREEWORDINLINE(0x3F3C, 0x403, 0xAA5E);
  1393. extern pascal OSErr IPMAddReplyQueue(IPMParamBlockPtr paramBlock, Boolean async)
  1394.  THREEWORDINLINE(0x3F3C, 0x41D, 0xAA5E);
  1395. extern pascal OSErr IPMOpenHFSMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1396.  THREEWORDINLINE(0x3F3C, 0x417, 0xAA5E);
  1397. extern pascal OSErr IPMGetBlkIndex(IPMParamBlockPtr paramBlock, Boolean async)
  1398.  THREEWORDINLINE(0x3F3C, 0x418, 0xAA5E);
  1399. extern pascal OSErr IPMGetMsgInfo(IPMParamBlockPtr paramBlock, Boolean async)
  1400.  THREEWORDINLINE(0x3F3C, 0x419, 0xAA5E);
  1401. #ifdef __cplusplus
  1402. }
  1403. #endif
  1404.  
  1405. /****************************************************************************************/
  1406. /* EXTERNAL ROUTINES */
  1407.  
  1408. #ifndef __OCEMessaging
  1409. #define __OCEMessaging(selector) = { 0x303C, selector, 0xAA5C}
  1410.  
  1411. #endif
  1412.  
  1413. #define kOCESizePackedRecipient 830
  1414. #define kOCEPackRecipient 831
  1415. #define kOCEUnpackRecipient 832
  1416. #define kOCEStreamRecipient 833
  1417. #define kOCEGetRecipientType 834
  1418. #define kOCESetRecipientType 835
  1419.  
  1420. #ifdef __cplusplus
  1421. extern "C" {
  1422. #endif
  1423.  
  1424. /*
  1425. Compute the space that a OCERecipient would take if it were in packed
  1426. form.  [Note: does NOT even pad extensionSize, so you may get an odd #back out]
  1427. Safe to pass dereferenced handle(s).
  1428. */
  1429.  
  1430. extern pascal unsigned short OCESizePackedRecipient(const OCERecipient *rcpt)
  1431.  THREEWORDINLINE(0x303C, 830, 0xAA5C);
  1432.  
  1433. /*
  1434. Take an OCERecipient (scatter) and (gather) stream into the specified
  1435. buffer.  It is assumed that there is sufficient space in the buffer (that is
  1436. OCESizePackedRecipient).  Safe to pass dereferenced handle(s).
  1437. */
  1438. extern pascal unsigned short OCEPackRecipient(const OCERecipient *rcpt, void *buffer)
  1439.  THREEWORDINLINE(0x303C, 831, 0xAA5C);
  1440.  
  1441. /*
  1442. Take a packed OCERecipient and cast a the OCERecipient frame over it. Returns
  1443. amBadDestId if it doesn't look like an OCERecipient. Safe to pass dereferenced
  1444. handle(s).
  1445. */
  1446. extern pascal OSErr OCEUnpackRecipient(const void *buffer, OCERecipient *rcpt, RecordID *entitySpecifier)
  1447.  THREEWORDINLINE(0x303C, 832, 0xAA5C);
  1448.  
  1449. /*
  1450. Take an OCERecipient (scatter) and (gather) stream using the specified
  1451. function.  Safe to pass dereferenced handle(s).  If streamer function returns
  1452. OCEError OCEStreamRecipient stops execution and passes the error back to the caller
  1453. */
  1454. typedef pascal OSErr (*OCERecipientStreamer)(void *buffer, unsigned long count, Boolean eof, long userData);
  1455.  
  1456. extern pascal OSErr OCEStreamRecipient(const OCERecipient *rcpt, OCERecipientStreamer stream, long userData, unsigned long *actualCount)
  1457.  THREEWORDINLINE(0x303C, 833, 0xAA5C);
  1458.  
  1459. /* Get the OCERecipient's extensionType. Safe to pass dereferenced handle(s).*/
  1460.  
  1461. extern pascal OSType OCEGetRecipientType(const CreationID *cid)
  1462.  THREEWORDINLINE(0x303C, 834, 0xAA5C);
  1463.  
  1464. /*
  1465. Set the OCERecipient's extensionType in the specified cid.  (Note: we do NOT
  1466. check for a nil pointer).  If the extensionType is 'entn', the cid is assumed
  1467. to be "valid" and is not touched.  Note: to properly handle non 'entn''s this
  1468. routine must and will zero the high long (source) of the cid! Safe to pass
  1469. dereferenced handle(s).
  1470. */
  1471. extern pascal void OCESetRecipientType(OSType extensionType, CreationID *cid)
  1472.  THREEWORDINLINE(0x303C, 835, 0xAA5C);
  1473. #ifdef __cplusplus
  1474. }
  1475. #endif
  1476.  
  1477. #endif
  1478.  
  1479.